<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
	<title>临时交易车辆信息</title>
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style" />
	<meta content="telephone=no" name="format-detection" />
	<link href="<%=basepath%>css/index.css" rel="stylesheet" type="text/css">
	<link href="<%=basepath%>css/parking.css" rel="stylesheet" type="text/css">
	<script src="<%=basepath%>js/jquery-1.8.3.min.js"></script>
	<script src="<%=basepath%>js/layer/layer.js"></script>
</head>
<body>
<div class="viewport">
	<div class="header">
       <div class="header-1">
           <a href="javascrpt:void(0)" id="join" class="header-2">
              <span id="account" class="account">${empty user.realName ? '' : user.realName}</span>&nbsp;&nbsp;<span id="deptName" class="deptName">${user.departmentName}</span>
           </a>
           <a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=yuexi&prefix=3g_mmzs&entrance=yes" class="back" id="back">返回</a>
           <span class="span-num">WMP22500</span>
       </div>
    </div>
	<form method="post" id="myForm" action="/wape-web/api/core/centerService">
		<input type="hidden" name="serviceCode" value="MMZS121" />
		<input type="hidden" name="queryType" value="4" />
		<div class="content m-top">
			<div class="blank"></div>
			<div class="content2-1">
				<div class="content2-1-1">
					<table>
						<tr>
							<td class="td-1">棚位分区：</td>
							<td class="td-2">${cp.storeName}
								<input type="hidden" name="storeId" value="${cp.storeId}" />
								<input type="hidden" name="storeName" value="${cp.storeName}" /></td>
							<td class="td-3">编号：</td>
							<td class="td-4">${cp.sonStoreName}
								<input type="hidden" name="sonStoreId" value="${cp.sonStoreId}" />
								<input type="hidden" name="sonStoreName" value="${cp.sonStoreName}" /></td>
						</tr>
					</table>
				</div>
			</div>
            <div class="blank"></div>
            <div class="vehicle5-1">
                <div class="vehicle5-1-1">
                    <table>
                        <tr>
                            <td>已审核</td>
                            <td>${cp.dispatcherDay} ${cp.dispatcherTime}</td>
                            <td>管理员：</td>
                            <td>${cp.dispatcherName}</td>
                        </tr>
                        <tr>
                            <td>已收费时长</td>
                            <td>${cp.dispatcherHours} 小时</td>
                            <td>收费员：</td>
                            <c:if test="${cp.chargerName_31 eq null}">
                            <td>${cp.chargerName_30}</td>
                            </c:if>
                            <c:if test="${cp.chargerName_31 ne null}">
                            <td>${cp.chargerName_31}</td>
                            </c:if>
                        </tr>
                    </table>
                </div>
            </div>
			<div class="content2-2"><div class="content2-2-1"><span class="span-1">车辆进场情况：</span><span class="span-2" id="sj">${cp.dispatcherDay } ${cp.dispatcherTime}</span></div></div>
			<div class="content2-1">
				<div class="content2-1-1">
					<table>
						<tr>
							<td class="td-1">联系电话：</td>
							<td>
								<input type="text" value="${cp.inRecordNum}" name="inRecordNum" readonly="readonly" class="input-2" value="1198668">
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div class="content2-1">
				<div class="content2-1-1">
					<table>
						<tr>
							<td class="td-1">承租人：</td>
							<td>
								<input type="text" class="input-2" value="${cp.plateNum}" readonly="readonly" name="plateNum">
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div class="content2-3"></div>
			<div class="content2-1">
				<div class="content2-1-1">
					<table>
						<tr>
							<td class="td-1">超时费用：</td>
							<td class="td-2">
                                <select name="rate" id="js-1">
                                    <option value="100">100</option>
                                    <option value="150">150</option>
                                </select>
							</td>
							<td class="td-5">元/天</td>
							<td class="td-3">实际天数：</td>
							<td class="td-4">
								<input type="text" value="${cp.overDay }" name="count" class="input-2 text-r" readonly="readonly" placeholder="0" onkeyup="value=value.replace(/[^\d.]/g,'')" id="js-2">
							</td>
							<td class="td-6">天</td>
						</tr>
					</table>
				</div>
			</div>
			<div class="hr"></div>
			<div class="content2-1">
				<div class="content2-1-1">
					<table>
						<tr>
							<td class="td-1">应缴费用：</td>
							<td class="td-2">
								<input type="text" name="costs" class="input-2 text-r" placeholder="0" readonly="readonly" id="js-3">
							</td>
							<td class="td-5">元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
							<td class="td-3">优惠金额：</td>
							<td class="td-4">
								<input type="text" name="benefit" value="0" class="input-2 text-r" placeholder="0" onkeyup="value=value.replace(/[^\d.]/g,'')" id="js-4">
							</td>
							<td class="td-6">元</td>
						</tr>
					</table>
				</div>
			</div>
			<div class="hr"></div>
			<div class="content2-1">
				<div class="content2-1-1">
					<table>
						<tr>
							<td class="td-1">实缴费用：</td>
							<td class="td-2">
								<input type="text" name="payment" readonly="readonly" class="input-2 text-r" placeholder="0" onkeyup="value=value.replace(/[^\d.]/g,'')" id="js-5">
							</td>
							<td class="td-5">元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
							<td class="td-3"></td>
							<td class="td-4"><input type="text" class="input-2" disabled="disabled" style="border: none;"></td>
							<c:set var="right" value=",2002,200201,200202,"></c:set>
							<c:if test="${(fn:indexOf(right, user.departmentId) != -1)}">
								<td class="td-6"><input type="button" class="button" value="确认缴费" id="abcd"></td>
							</c:if>
						</tr>
					</table>
				</div>
			</div>
			<div class="content2-3"></div>
			<div class="blank"></div>
			<div class="content2-1">
				<div class="content2-1-1">
					<table>
						<tr>
							<td class="td-1 bold">商品种类：</td>
							<td class="td-2">
								<input type="text" class="input-2 text-left" value="${cp.goodsKingdom}" name="goodsKingdom" readonly="readonly" id="js-1">
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div class="hr"></div>
			<div class="content2-1">
				<div class="content2-1-1">
					<table>
						<tr>
							<td class="td-1 bold">商品名称：</td>
							<td>
								<input type="text" class="input-2 text-left" value="${cp.goodsInfo}" name="goodsInfo" readonly="readonly">
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div class="content2-2"><div class="content2-2-1"><span>其他备注情况</span></div></div>
			<div class="content2-4"><textarea rows="" cols="" name="remark" readonly="readonly"></textarea></div>
			<div class="space"></div>
		</div>
	</form>
</div>
</body>
<script type="text/javascript">
	/*错误提示*/
	   $(function(){
	       var error = "${requestScope.returnMsg}";
	       if(error != "" && error != "成功!"){
	           layer.msg(error,{shadeClose:true,shade:0.1,time:2000});
	       }
	   });
	/*时间*/
	function getNowFormatDate() {
		var date = new Date();
		var seperator1 = "-";
		var seperator2 = ":";
		var month = date.getMonth() + 1;
		var strDate = date.getDate();
		if (month >= 1 && month <= 9) {
			month = "0" + month;
		}
		if (strDate >= 0 && strDate <= 9) {
			strDate = "0" + strDate;
		}

		var hours = date.getHours()>9?date.getHours():("0"+date.getHours());
		var minutes = date.getMinutes()>9?date.getMinutes():("0"+date.getMinutes());
		var seconds = date.getSeconds()>9?date.getSeconds():("0"+date.getSeconds());
		var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
				+ " " + hours + seperator2 + minutes
				+ seperator2 + seconds;
		sj.innerHTML=currentdate;
	}
	$(function(){
		setInterval("getNowFormatDate()",1000);
	});
	/*计算*/
	$(function(){

        /*
        var _date = new Date();
        var _dh = '${cp.dispatcherHours}';
        var _dd = '${cp.dispatcherDay}';
        var _dt = '${cp.dispatcherTime}';
        var _inDate = new Date(_dd + " " + _dt);
        
        var _day = (_date - _inDate) / 86400000;
        if(_day < Number(_dh) / 24) {
            $('#abcd').hide();
        }
        var _d = (_date - _inDate) / 86400000 - Number(_dh) / 24;
        $('#js-2').val(Math.ceil(Math.round(_d*100)/100));
        */
        var _overDay = Number('${cp.overDay}');
        if(_overDay > 0) {
            $('#abcd').hide();
        }

		var s1 = $("#js-1").val();
		var s2 = $("#js-2").val();
		var s4 = $("#js-4").val();
		var s3 = Math.round(s1*s2*100)/100;
		$("#js-3").val(s3);
		var s5 = s3-Number(Math.round(s4));
		$("#js-5").val(s5);
		
        $("#js-1").change(function(){
            var s1 = $("#js-1").val();
            var s2 = $("#js-2").val();
            var s4 = $("#js-4").val();
            var s3 = Math.round(s1*s2*100)/100;
            $("#js-3").val(s3);
            var s5 = Math.floor(Number(s3)-Number(Math.round(s4)));
            $("#js-5").val(s5);
        });

		$("#js-4").keyup(function(){
			var s1 = $("#js-1").val();
			var s2 = $("#js-2").val();
			var s4 = $("#js-4").val();
			var s3 = Math.round(s1*s2*100)/100;
			$("#js-3").val(s3);
			var s5 = Math.floor(Number(s3)-Number(Math.round(s4)));
            if(s5 < 0) {
                layer.msg("优惠金额应小于应缴金额",{shadeClose:true,shade:0.1,time:2000});
                $("#js-4").val('0');
                s5 = s1*s2;
            }
            $("#js-5").val(s5);
		});
	});
	/*提交*/
	$(function(){
        var error = "${requestScope.remsg}";
        if(error != ""){
          layer.msg(error,{shadeClose:true,shade:0.1,time:2000});
        } 
        
		$("#abcd").click(function(){
			layer.confirm('您确认提交吗', {icon: 3, title:'提交'}, function(index){
				$("#myForm").submit();
				layer.close(index);
				layer.load();
		        
			});
		});
	});
</script>
</html>



